import React, { useEffect, useState } from 'react';

/**
*
*/
const TestPay = () => {
  const [url, setUrl] = useState(window.location.href);
  useEffect(() => {
    setUrl(window.location.href);
  }, []);
  const getAuth = () => {
    window.location.href = `http://357h3r0792.picp.vip/wx/login?userId=618e69c6-6ae7-4b42-8221-a99ad2530a5e&url=${window.location.href}`;
  };
  return (
    <div style={{
      height: '100vh', display: 'flex', justifyContent: 'center', alignItems: 'center'
    }}
    >
      <button type="button" onClick={() => getAuth()}>去授权</button>
      <button type="button">去支付</button>
      <p>{url}</p>
    </div>
  );
};

export default TestPay;
